<template>
  <div class="User">
    <h1>User: {{ userId }}</h1>
    <!--    <h1>{{ $route.params }}</h1>-->
  </div>
</template>

<script>
export default {
  name: "User",
  data() {
    return {
      userId: null,
    };
  },
  created() {
    // 当前页面的参数
    console.log(this.$route);
    const { id } = this.$route.params;
    this.userId = id;
    // /path/params
    // /path/params?query#hash
  },
};
</script>

<style scoped></style>
